import request from '@/utils/request'
// 获取菜单列表
export function getMenuPage(params) {
  return request({
    url: '/menu/menuList',
    method: 'get',
    params
  })
}

export function createMenu(data) {
  return request({
    url: '/menu/',
    method: 'post',
    data
  })
}

export function menuInfo(params) {
  return request({
    url: '/menu/menuInfo',
    method: 'get',
    params
  })
}

export function updateMenu(data) {
  return request({
    url: '/menu/updateMenuInfo',
    method:'post',
    data
  })
}

export function deleteMenu(id) {
  return request({
    url: `/menu/deleteMenu/${id}`,
    method: 'get',
  })
}

export function updateStatus(id,status) {
  return request({
    url: `/menu/updateStatus/${id}/${status}`,
    method: 'get',
  })
}
// 获取所有菜单列表
export function getMenuAll() {
  return request({
    url: '/menu/getMenuAll',
    method: 'get'
  })
}

export function permissionAssignment() {
  return request({
    url: '/menu/permissionAssignment',
    method: 'get'
  })
}